package com.mdd.maduoduo.domain.interactor;

import com.mdd.maduoduo.domain.executor.PostExecutionThread;
import com.mdd.maduoduo.domain.executor.ThreadExecutor;
import com.mdd.maduoduo.domain.repository.LoginRepository;
import com.mdd.maduoduo.entity.Response;

import java.util.HashMap;

import javax.inject.Inject;

import io.reactivex.Observable;

public class ExchangeData extends UseCase<Response, ExchangeData.Params>{

    @Inject
    LoginRepository mRepository;

    @Inject
    ExchangeData(ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread) {
        super(threadExecutor, postExecutionThread);
    }

    @Override
    Observable<Response> buildUseCaseObservable(Params params) {
        return mRepository.exchange(params.map);
    }

    public static final class Params {
        private HashMap<String, Object> map;

        public HashMap<String, Object> getMap() {
            return map;
        }

        public void setMap(HashMap<String, Object> map) {
            this.map = map;
        }
    }
}
